<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        属性独立
        方法共享
      */
      let hamster = {
        stomach: [],
        eat(food) {
          this.stomach.push(food);
        },
      };
      let speedy = {
        stomach: [], //['apple']
        __proto__: hamster,
      };
      let lazy = { stomach: [], __proto__: hamster };
      // 这只仓鼠找到了食物
      speedy.eat('apple');
      // speedy.stomach.push('apple');
      console.log(speedy.stomach); // apple
      // 这只仓鼠也找到了食物，为什么？请修复它。
      console.log(lazy.stomach); // []
    </script>
  </body>
</html>
